package br.com.unieuro.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.unieuro.dominio.Config;
import br.com.unieuro.facade.ManterConfigFacade;

public class FrontControllerMonitoramento extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {

		String pagina = req.getParameter("pagina");		
		if ((pagina != null) && (pagina.equals("iniciaMonitorar"))) {
			
			ManterConfigFacade facade = new ManterConfigFacade();
			
			Config conf = new Config();
			conf.setInicia (req.getParameter("botao"));
			facade.updateConfig(conf);

			resp.sendRedirect("jsp/monitoramento.jsp");
		}		
	}
}

	

